package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.TextView;

public class SuccessActivity extends AppCompatActivity {
    private TextView successtxt;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_success);
        successtxt=findViewById(R.id.successtxt);
        SharedPreferences sp=getSharedPreferences("userinfo",MODE_PRIVATE);
        String usn=sp.getString("username","");
        String psd=sp.getString("password","");
        Intent intent=getIntent();
        int uid= intent.getIntExtra("userid",-1);
        successtxt.setText("你好，"+uid+"号用户"+usn+",你的密码是"+psd);
    }
}
